const mixin = {
    props: {
        /**
         * 占比份数，默认占一份 - 需开启AntFrom百分比布局属性percentageLayout才生效
         */
        copies: {
            type: Number,
            default: 1
        }
    },
    data() {
        return {
            /**
             * 百分比布局宽度
             */
            percentageLayoutWidth: null
        }
    },
    mounted() {
        const labelDiv = this.$refs.labelDiv
        if (labelDiv) {
            // 手动覆盖::after
            labelDiv.parentNode.setAttribute('class', 'c-label')
            const labelParentHeight = labelDiv.parentNode.parentNode.getBoundingClientRect().height
            const labelDivHeight = labelDiv.getBoundingClientRect().height
            labelDiv.style.marginTop = (labelParentHeight - labelDivHeight) / 2 + 'px'
        }
    },
    computed: {
        /**
         * 判断组件是否禁用，这里AntFrom组件会设置cdisabled的值
         * @returns {*}
         */
        isDisabled() {
        return this.cdisabled ? this.cdisabled : this.disabled
        }
    }
}

export { mixin }
